package com.cj.mobile.iabp.mvp.model.api.service;

import com.cj.mobile.iabp.mvp.model.entity.AccountInfo;
import com.cj.mobile.iabp.mvp.model.entity.DepotHomeResponse;
import com.cj.mobile.iabp.mvp.model.entity.DeptInfo;
import com.cj.mobile.iabp.mvp.model.entity.DictInfo;
import com.cj.mobile.iabp.mvp.model.entity.LoginResponse;
import com.cj.mobile.iabp.mvp.model.entity.PatientDetail;
import com.cj.mobile.iabp.mvp.model.entity.PatientInfo;
import com.cj.mobile.iabp.mvp.model.entity.RegisterResponse;
import com.cj.mobile.iabp.mvp.model.entity.RegisterUploadResponse;
import com.cj.mobile.iabp.mvp.model.entity.StatisticsResponse;
import com.cj.mobile.iabp.mvp.model.entity.UploadPicResponse;
import com.jess.arms.cj.CommonResponse;
import com.jess.arms.cj.GsonResponse;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * 包名： PACKAGE_NAME
 * 对象名： AccountService
 * 描述：账户相关接口
 * 作者： wly
 * 邮箱：wangliyang206@163.com
 * 创建日期： 2017/3/24 10:03
 */

public interface AccountService {

    /*-----------------------------------------------------------------------用户基本-----------------------------------------------------------------------*/
    //登录
    @POST("api/accountLogin")
    Observable<GsonResponse<LoginResponse>> toLogin(@Body Map<String, Object> request);

    //快捷登录
    @POST("api/accountLogin")
    Observable<GsonResponse<LoginResponse>> quickLogin(@Body Map<String, String> request);

    //登录-获取短信验证码
    @POST("api/sendCode")
    Observable<GsonResponse<CommonResponse>> loginSMS(@Body Map<String, String> request);

    //修改密码
    @POST("account/changePassword")
    Observable<GsonResponse<Boolean>> changePassword(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    // 发送短信验证码
    @POST("member/forgetPassword")
    Observable<GsonResponse<CommonResponse>> sendSms(@Body Map<String, Object> request);

    // 重置密码
    @POST("member/resetPwd")
    Observable<GsonResponse<CommonResponse>> forgotPassword(@Body Map<String, Object> request);

    // 上传照片 图片类型 3经营许可证(仓库暂存点)、4资质商头像、5调拨确认入库视频、6出库单图片、7签收单图片、8运单照片、9暂存点头像、10工作证明、11货物照片、12上传凭证(多张)、13销售送货单附件、14收款单图片。
    @Multipart                                //标记一个请求是multipart/form-data类型
    @POST("fileUploadController/uploadImage")
    Observable<GsonResponse<UploadPicResponse>> upload(@Part("type") RequestBody type, @Part("key") RequestBody key, @Part("userId") RequestBody userId, @Part MultipartBody.Part file);

    // 注册上传多组文件
    @Multipart                                //标记一个请求是multipart/form-data类型
    @POST("fileUploadController/uploadFiles")
    Observable<GsonResponse<RegisterUploadResponse>> uploadFilesWithParts(@Part("phone") RequestBody phone, @Part List<MultipartBody.Part> file);

    // 下载
    @Streaming
    @GET()
    Observable<ResponseBody> download(@Url String Url);
    /*-----------------------------------------------------------------------账号-----------------------------------------------------------------------*/

    // 发送发短信
    @POST("organizationRegister/verificationCode")
    Observable<GsonResponse<CommonResponse>> verificationCode(@Body Map<String, Object> request);

    // 验证短信
    @POST("organizationRegister/verificationSms")
    Observable<GsonResponse<RegisterResponse>> verificationSms(@Body Map<String, Object> request);

    // 获取个人信息
    @POST("account/accountInfo")
    Observable<GsonResponse<AccountInfo>> getUserInfo(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    // 获取部门(院区、科室)
    @POST("dept/selectDeptPC")
    Observable<GsonResponse<List<DeptInfo>>> getDeptList(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    // 修改个人信息
    @POST("account/updateAccount")
    Observable<GsonResponse<CommonResponse>> updateUserInfo(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    /*-----------------------------------------------------------------------首页-----------------------------------------------------------------------*/

    //获取首页订单
    @POST("count/main")
    Observable<GsonResponse<DepotHomeResponse>> getHomeInfo(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //搜索
    @POST("patient/searchParam")
    Observable<GsonResponse<List<PatientInfo>>> searchContent(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    // 删除患者信息
    @POST("patient/removePatient")
    Observable<GsonResponse<String>> removePatient(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //字典：诊断type=1；手术type=2；医生type=3
    @POST("dict/dictList")
    Observable<GsonResponse<List<DictInfo>>> getDictList(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    @Multipart                                //标记一个请求是multipart/form-data类型
    @POST("file/uploadImages")
    Observable<GsonResponse<List<String>>> uploadImages(@Header("Authorization") String authorization,@Part("doctorId") RequestBody doctorId, @Part List<MultipartBody.Part> file);

    //新增手术信息
    @POST("surgery/addSurgeryAPP")
    Observable<GsonResponse<Integer>> addSurgery(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    // 修改手术信息
    @POST("surgery/updateSurgery")
    Observable<GsonResponse<Integer>> updateSurgery(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //新增 查房信息
    @POST("rounds/addRounds")
    Observable<GsonResponse<Integer>> addRounds(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    // 修改查房信息
    @POST("rounds/updateRounds")
    Observable<GsonResponse<Integer>> updateRounds(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //新增撤机信息
    @POST("remove/addRemove")
    Observable<GsonResponse<Integer>> addRemove(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //修改撤机信息
    @POST("remove/updateRemove")
    Observable<GsonResponse<Integer>> updateRemove(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //新增归档信息
    @POST("archive/addArchive")
    Observable<GsonResponse<Integer>> addArchive(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //修改归档信息
    @POST("archive/updateArchive")
    Observable<GsonResponse<Integer>> updateArchive(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //vis计算
    @POST("count/getVis")
    Observable<GsonResponse<Double>> getVis(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    //计算 撤机运行时间
    @POST("count/getRunTime")
    Observable<GsonResponse<String>> getRunTime(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //添加患者
    @POST("patient/addPatient")
    Observable<GsonResponse<PatientInfo>> addPatient(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //修改患者信息
    @POST("patient/updatePatient")
    Observable<GsonResponse<Integer>> updatePatient(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //获取患者详情
    @POST("patient/detail")
    Observable<GsonResponse<PatientDetail>> getPatientDetail(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //删除查房信息
    @POST("rounds/removeRounds")
    Observable<GsonResponse<Integer>> removeRounds(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //获取患者基本信息
    @POST("patient/info")
    Observable<GsonResponse<PatientInfo>> getPatientBasicInfo(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    //获取患者手术信息
//    @POST("surgery/info")
//    Observable<GsonResponse<SurgeryInfo>> getPatientSurgeryInfo(@Header("Authorization") String authorization, @Body Map<String, Object> request);
    /*-----------------------------------------------------------------------统计-----------------------------------------------------------------------*/
    @POST("count/countMain")
    Observable<GsonResponse<StatisticsResponse>> getStatisticsCounnt(@Header("Authorization") String authorization, @Body Map<String, Object> request);

    /*-----------------------------------------------------------------------我的-----------------------------------------------------------------------*/

    // 获取用户流程
//    @POST("esign/getUserStep")
//    Observable<GsonResponse<SignStateInfo>> getSignState(@Body Map<String, Object> request);
}
